package kingiis.utils.projectreader;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Handler;
import android.view.Gravity;
import android.view.View;
import android.widget.PopupWindow;

import butterknife.OnClick;
import kingiis.utils.projectreader.pop.UrlPop;
import kingiis.utils.simpleapp.BAct;
import kingiis.utils.simpleapp.anno.Layout;
import kingiis.utils.simpleapp.anno.Vertical;

/**
 * 功能点
 * 1 检出代码
 */

@Vertical
@Layout(R.layout.activity_main)
public class MainActivity extends BAct {

    @Override
    public void initView() {
        init();
    }

    @Override
    public void initListener() {

    }

    @Override
    public Handler onFinish() {
        return null;
    }

    @OnClick({
            R.id.btn1,
            R.id.btn2,
            R.id.btn3,
    })
    void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn1:
                pop.showAtLocation(view, Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
                break;
            case R.id.btn2:
                break;
            case R.id.btn3:
                break;
            default:
                break;
        }
    }

    PopupWindow pop;

    private void init() {
        pop = UrlPop.get(context, new UrlPop.onBtnClickListener() {
            @Override
            public void onOkClick(String res) {

            }

            @Override
            public void onDismiss() {

            }
        });
    }

}
